package com.leo.auth.controller;

import com.leo.auth.entity.User;
import com.leo.auth.service.IUserService;
import com.leo.common.core.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户 前端控制器
 * </p>
 *
 * @author Leo
 * @since 2021-04-07
 */
@RestController
@RequestMapping("/token")
public class UserController {
    @Autowired
    private IUserService userService;


    @PostMapping("userLogin")
    public Result<Void> userLogin(@RequestBody User user) {
        System.out.println(user);
        return Result.ok();
    }

    @GetMapping("getUser")
    public Result<List<User>> getUser() {
        List<User> list = userService.list();
        return Result.ok(list);
    }

}


